package com.key.modules.mapper;

import com.key.modules.cache.MybatisCache;
import com.key.modules.entity.Carrier;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
* @author wei
* @description 针对表【carrier(承运商表)】的数据库操作Mapper
* @createDate 2023-03-23 19:31:49
* @Entity com.key.modules.entity.Carrier
*/
@Repository
@CacheNamespace(implementation = MybatisCache.class, eviction = MybatisCache.class)
public interface CarrierMapper extends BaseMapper<Carrier> {

    /**
     * 根据承运商名称查询承运商ID
     * @author wei
     * @param cName
     * @return
     */
    @Select("select c_id from carrier where c_name = #{cName}")
    Integer selectCIdByCName(@Param("cName") String cName);

    /**
     * 根据承运商ID查询承运商名称
     * @author wei
     * @param cId
     * @return
     */
    @Select("select c_name from carrier where c_id = #{cId}")
    String selectCNameByCId(@Param("cId") Integer cId);

}




